1.Introduction to the dataset

2.Why choose this dataset?

3.Early tables and graphs

gp <- supermarket %>%
    group_by(City,Product_line) %>%
    summarise(total_sales = sum(Total)) %>%
    ggplot()+
    geom_col(mapping = aes(x=Product_line, y=total_sales ,fill= City),color="black",size=0.5,position = "dodge"  )+
    theme_classic()+
    scale_fill_brewer(palette = "Set3")+
    theme(axis.text.x = element_text(angle = 10, vjust = 0.8))+
    labs(x = "Product Line", y = "Total Sales", title = "Sales of Product Lines")

ggplotly(gp)

First insight: Naypyitaw store has the highest sales in the “Food and beverages” line, Yangon store has the highest sales in the “Home and lifestyle” line, while Mandalay has the highest sales in the “Sports and travel” line, Therefore, each store can increase the quantity of such products.


gp <- supermarket %>%
    group_by(Month,City) %>%
    summarise(total_sales = sum(Total)) %>%
    ggplot()+
    geom_line(mapping = aes(x=Month, y=total_sales ,color= City),size=1,position = "dodge"  )+
    theme_classic()+
    scale_color_brewer(palette = "Set2")+
    theme(axis.text.x = element_text(angle = 10, vjust = 0.8))+
    scale_x_continuous(breaks = c(1, 2, 3))+
    labs(x = "Month", y = "Total Sales", title = "Sales trend of each branch")+
    geom_point(mapping = aes(x=Month, y=total_sales ),size=1,fill= "black" )

ggplotly(gp)

First insight: The sales volume of the three branches all fell sharply in February, and then rebounded in March, among which Yangon dropped the most. We can carefully analyze whether the supermarket made a big move in February, or whether there was a big change in the external market environment, which led to the sharp decline in sales volume.


gp <- supermarket %>%
    group_by(Month,Customer_type,City) %>%
    summarise(total_sales = sum(Total)) %>%
    ggplot()+
    geom_line(mapping = aes(x=Month, y=total_sales,color= Customer_type,linetype=City),size=1,position = "dodge"  )+
    theme_classic()+
    scale_color_brewer(palette = "Set2")+
    theme(axis.text.x = element_text(angle = 10, vjust = 0.8))+
    scale_x_continuous(breaks = c(1, 2, 3))+
    labs(x = "Month", y = "Total Sales", title = "Sales trend of each branch with different membership")

ggplotly(gp)

First insight: Members of Yangon Store have the best quality, and their sales have always been higher than Normal customers. However, in March, the quality of Members declined, and the sales volume of Normal customers was higher than that of Members. Therefore, marketing activities can be considered to convert these high-quality customers into Members.


gp <- supermarket %>%
    group_by(City,Customer_type) %>%
    summarise(mean_rating = mean(Rating)) %>%
    ggplot()+
    geom_col(mapping = aes(x=City, y=mean_rating ,fill= Customer_type),color="black",size=0.5,position = "dodge"  )+
    theme_classic()+
    scale_fill_brewer(palette = "Set3")+
    geom_hline(yintercept = mean(supermarket$Rating), color = "red", linetype = "dashed")+
    geom_text(aes(x = 1.1, y = 7.3, label = paste("Average Rating:",mean(supermarket$Rating))))+
    theme(axis.text.x = element_text(angle = 10, vjust = 0.8))+
    labs(x = "Product Line", y = "Total Sales", title = "Sales of Product Lines")

ggplotly(gp)

First insight: The user ratings of Mandalay stores are all lower than the average line, so it is necessary to understand the reasons as soon as possible and take corresponding measures to prevent further customer loss. Both Naypyitaw and Yangon stores have very high Normal customer ratings, so marketing campaigns can be taken to convert these Normal customers into members.


4.First look of the application

Below is a first version of what the application could look like.

There are four main areas:

Area1: This area is Sidebar. Includes navigation menus, filters to control filters for charts and tables on the right to dynamically display different data.

Area2: This area is tabBox. I will use tabBox to control the two question directions “Sales questions” and “Customer experience questions” that I hope to study. Under each tab, there will be different tabPanels to control different charts or tables.

Area3: This area is tabPanel. This section will have different navigation content depending on the type of tabBox question above. After clicking, different graphs or tables will be displayed, and each navigation will do a topic that I want to study

Area4: This area is Body. It contains charts, tables, etc., used to show the main content of the application, the most core chart information will be shown here for our analysis, and there will be a conclusion below the chart.